﻿@* Generator: Template *@
@functions { public dynamic Model { get; set; } }@{
    var dotModule = Model.Module == null ? "" : ("." + Model.Module);
    var moduleDot = Model.Module == null ? "" : (Model.Module + ".");
}
namespace @(Model.RootNamespace)@(dotModule).Columns
{
    using Serenity;
    using Serenity.ComponentModel;
    using Serenity.Data;
    using System;
    using System.ComponentModel;
    using System.Collections.Generic;
    using System.IO;

    [ColumnsScript("@(moduleDot)@(Model.ClassName)")]
    [BasedOnRow(typeof(Entities.@(Model.RowClassName)))]
    public class @(Model.ClassName)Columns
    {@foreach (EntityField x in Model.Fields) {
        var attrs = new List<string>();
        if (x.Ident == Model.IdField) {
            attrs.Add("EditLink");
            attrs.Add("DisplayName(\"Db.Shared.RecordId\")");
            attrs.Add("AlignRight");
        }
        else if (x.Ident == Model.NameField) {
            attrs.Add("EditLink");
        }
        if (attrs.Count > 0)
        {<text>
        [@string.Join(", ", attrs)]</text>}<text>
        public @x.DataType @x.Ident { get; set; }</text>}

    }
}